import { Provide } from '@midwayjs/core';
import { BaseService } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { OrderCityEntity } from '../entity/city';

/**
 * 订单模块-店铺信息Service
 */
@Provide()
export class OrderCityService extends BaseService {
    @InjectEntityModel(OrderCityEntity)
    orderCityEntity: Repository<OrderCityEntity>;

    
    async getSelectList() {
        const city = await this.orderCityEntity.find({});
        return city.map(city => ({
            label: city.cityName,
            value: city.id
        }));
    }
}
